/**
 * This file was created by Nick Popescu for use in SpaceTrader
 */

import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.event.ChangeListener;

/**
 * This is the View component, which deals with methods associated with getting
 * and setting GUI-related information.
 * 
 * @author Nick Popescu
 * @version 1.0
 */

public interface View {
    /**
     * Gets the name from the Name Box in the Character Creation menu.
     * 
     * @return Name from the Name Box.
     */
    String getName();

    /**
     * Gets the default text inside of the Name Box during character creation.
     * 
     * @return Default text inside of the Name Box.
     */
    String getDefaultName();

    /**
     * Gets the number of the skill points that have been used up.
     * 
     * @return The number of skill points that have been used up.
     */
    int getSkillPoints();

    /**
     * Used to show the Initial Configuration Screen
     */
    void show();

    /**
     * Enables/disables the Accept Button in the Character Creation, based on
     * the flag.
     * 
     * @param flag
     *            True enables the button, False disables it.
     */
    void enableAccept(boolean flag);

    /**
     * Detects if the Spinners for the skills have been changed/updated with new
     * values.
     * 
     * @param cl
     *            The listener for the change.
     */
    void detectSkillChange(ChangeListener cl);

    /**
     * Displays/Hides the Error message JLabel if the Name input is faulty.
     * 
     * @param flag
     *            True shows the error, false hides the message.
     */
    void displayNameError(boolean flag);

    /**
     * Updates the JLabel for the number of the remaining skill points.
     * 
     * @param remaining
     *            The number of the remaining skill points.
     */
    void updateSkillsRemaining(int remaining);

    /**
     * Used to get all of the JSpinners (skill allocators) from the GUI.
     * 
     * @return An Array of all the skill JSpinners.
     */
    JSpinner[] getSpinners();

    /**
     * Places the skill point assignments into an array and returns it.
     * 
     * @return The array of all the skill point assignments.
     */
    int[] getSkillPointArray();

    /**
     * Used by the Accept Button to see if it was clicked.
     * 
     * @param al
     *            The listener for the Accept Button.
     */

    void registerAccept(ActionListener al);

    /**
     * Displays the given screen in the game's Frame.
     * 
     * @param panel
     *            The JPanel (screen) that is to be displayed by the Frame.
     */
    void showScreen(JPanel panel);
}